package realm.inorder.itmill.session;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

@Component
public class SessionContext {

	private static Map<Class, Object> context = new HashMap<Class, Object>();
	
	public static <V> void put(Class<V> type, V v) {
		if (v == null) {
			context.remove(type);
		}
		context.put(type, v);
	}
	
	public static <V> V get(Class<V> type) {
		return (V) context.get(type);
	}
	
	public static <V> void remove(Class<V> type) {
		context.remove(type);
	}
	
}
